<script type="text/javascript" src="<?php echo base_url()?>js/jquery-ui.js"></script>
<script>
    $(function() {
       $( "#datepicker" ).datepicker({
			changeMonth:true,
			changeYear:true
       });
    });
</script>
<?php 
//
$input_ten_nguoidung = array(
		'name' => 'ten_nguoidung',
		'autofocus' => 'TRUE',
		'value' => set_value('ten_nguoidung'),
		'class' => 'styleinput'
);
$input_matkhau_nguoidung = array(
		'name' => 'matkhau_nguoidung',
		'value' => '',
		'class' => 'styleinput'
);
$input_tenthat_nguoidung = array(
		'name' => 'tenthat_nguoidung',
		'value' => set_value('tenthat_nguoidung'),
		'class' => 'styleinput'
);
$input_chucvu_nguoidung = array(
		'name' => 'chucvu_nguoidung',
		'value' => set_value('chucvu_nguoidung'),
		'class' => 'styleinput'
);
$input_ngaysinh_nguoidung = array(
		'name' => 'ngaysinh_nguoidung',
		'value' => set_value('ngaysinh_nguoidung'),
		'class' => 'styleinput',
		'id' => 'datepicker',
		'style' => 'width:100px;'
);
$input_phong_nguoidung = array(
		'name' => 'phong_nguoidung',
		'value' => set_value('phong_nguoidung'),
		'class' => 'styleinput',
		'id' => 'datepicker',
);
$input_sodienthoai_nguoidung = array(
		'name' => 'sodienthoai_nguoidung',
		'value' => set_value('sodienthoai_nguoidung'),
		'class' => 'styleinput',
		'id' => 'datepicker',
);
$input_email_nguoidung = array(
		'name' => 'email_nguoidung',
		'value' => set_value('email_nguoidung'),
		'class' => 'styleinput',
		'id' => 'datepicker',
);
$dropdown_phongban = array(
		''	=> 'Unknown',
		);
foreach($listLich as $l){
	$dropdown_phongban[$l['id_danhsachlich']] = $l['ten_lich'];
}

foreach($listQuyen as $lq){
	$checkbox[$lq['ten_quyen']] = array(
			'name'        => 'quyen[]',
			'class'       => 'stylecheckbox',
			'value'       => $lq['id_quyen'],
			'style'       => 'margin:10px',
	);
}
$input_date = array(
		'name' => 'date',
		'value' => date("Y-m-d H:i:s"),
		'disabled' => TRUE,
		'class' => 'styledate'
);
$button = array(
		'name' => 'button',
	    'id' => 'button',
	    'value' => 'true',
	    'type' => 'submit',
	    'content' => 'Thêm người dùng',
		'class' => 'stylebutton'
);
echo "<div class='content'> ";
echo "<h2>Thêm người dùng mới</h2>";
echo form_open("user/add");
echo form_label('Tên đăng nhập',"",array('class'=>'stylelabel'))."</br>";
echo form_input($input_ten_nguoidung).form_error('ten_nguoidung')."</br>";

echo form_label('Mật khẩu',"",array('class'=>'stylelabel'))."</br>";
echo form_password($input_matkhau_nguoidung).form_error('matkhau_nguoidung')."</br>";

echo form_label('Tên thật',"",array('class'=>'stylelabel'))."</br>";
echo form_input($input_tenthat_nguoidung)."</br>";

echo form_label('Chức vụ',"",array('class'=>'stylelabel'))."</br>";
echo form_input($input_chucvu_nguoidung)."</br>";

echo form_label('Ngày sinh',"",array('class'=>'stylelabel'))."</br>";
echo form_input($input_ngaysinh_nguoidung)."</br>";

echo form_label('Phòng ban',"",array('class'=>'stylelabel'))."</br>";
echo form_input($input_phong_nguoidung)."</br>";

echo form_label('Số điện thoại',"",array('class'=>'stylelabel'))."</br>";
echo form_input($input_sodienthoai_nguoidung)."</br>";

echo form_label('Email',"",array('class'=>'stylelabel'))."</br>";
echo form_input($input_email_nguoidung)."</br>";

echo form_label('Thuộc danh sách lịch',"",array('class'=>'stylelabel'))."</br>";
echo form_dropdown('phongban',$dropdown_phongban,"","class='styledrop'")."</br>";

echo form_label('Danh sách quyền',"",array('class'=>'stylelabel'))."</br>";
//echo form_multiselect('quyen[]',$selec_multi_quyen,"","class='styleselect'")."</br>";

foreach($checkbox as $ten_quyen => $id_quyen){
	echo form_checkbox($checkbox[$ten_quyen]).$ten_quyen."</br>";
}

echo form_input($input_date)."</br>";

echo form_button($button);

echo form_close();
echo '<div style="clear:both"></div></div></div>';
?>